
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询主页面</title>
</head>
<script src="${pageContext.request.contextPath}/js/jquery-3.3.1.min.js"></script>

<script src="${pageContext.request.contextPath}/js/util/jstree/dist/jstree.min.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/js/util/jstree/dist/themes/default/style.min.css">

<script type="text/javascript">
   $(document).ready(function() {
       //加载树形结构
       initRegionTree();
   });

   function initRegionTree(){
       $("#regionTree").jstree({
           'core': {
               "data" : {
                   "dataType" : 'json',
                   "opts":{
                       method: "GET"
                   },
                   "url" : function(node){
                       return "${pageContext.request.contextPath}/databasesearch/queryAllDataBase.action?id=" + node.id;
                   },
                   "data" : function(node){
                       if(node.id !="#"){
                           return {"id" : node.id};
                       }
                       return {"id" : 0};//写自己的加载数据
                   }
               },
               "themes": {
                   "theme" : "apple"
               },
               "multiple" : false//可以多选
           }
       });

   }

</script>
<body>
<div id="regionTree" style="margin-left:20px;"></div>
<iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe>
<form id="dataForm" action="${pageContext.request.contextPath}/filterandsearch/saveFilterData.action" method="post" target="nm_iframe">
    <div id="treeid">

    </div>
</form>
</body>
</html>
